<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
      <title>Geometry Objects | HiAPI-C# 2025 </title>
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <meta name="title" content="Geometry Objects | HiAPI-C# 2025 ">
      
      
      <link rel="icon" href="../../../../img/HiAPI.favicon.ico">
      <link rel="stylesheet" href="../../../../public/docfx.min.css">
      <link rel="stylesheet" href="../../../../public/main.css">
      <meta name="docfx:navrel" content="../../../../toc.html">
      <meta name="docfx:tocrel" content="../../toc.html">
      
      <meta name="docfx:rel" content="../../../../">
      
      
      
      <meta name="loc:inThisArticle" content="In this article">
      <meta name="loc:searchResultsCount" content="{count} results for &quot;{query}&quot;">
      <meta name="loc:searchNoResults" content="No results for &quot;{query}&quot;">
      <meta name="loc:tocFilter" content="Filter by title">
      <meta name="loc:nextArticle" content="Next">
      <meta name="loc:prevArticle" content="Previous">
      <meta name="loc:themeLight" content="Light">
      <meta name="loc:themeDark" content="Dark">
      <meta name="loc:themeAuto" content="Auto">
      <meta name="loc:changeTheme" content="Change theme">
      <meta name="loc:copy" content="Copy">
      <meta name="loc:downloadPdf" content="Download PDF">

      <script type="module" src="./../../../../public/docfx.min.js"></script>

      <script>
        const theme = localStorage.getItem('theme') || 'auto'
        document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
      </script>

  </head>

  <body class="tex2jax_ignore" data-layout="" data-yaml-mime="">
    <header class="bg-body border-bottom">
      <nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
        <div class="container-xxl flex-nowrap">
          <a class="navbar-brand" href="../../../../index.html">
            <img id="logo" class="svg" src="../../../../img/HiAPI.logo.png" alt="">
            
          </a>
          <button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
            <i class="bi bi-three-dots"></i>
          </button>
          <div class="collapse navbar-collapse" id="navpanel">
            <div id="navbar">
              <form class="search" role="search" id="search">
                <i class="bi bi-search"></i>
                <input class="form-control" id="search-query" type="search" disabled placeholder="Search" autocomplete="off" aria-label="Search">
              </form>
            </div>
          </div>
        </div>
      </nav>
    </header>

    <main class="container-xxl">
      <div class="toc-offcanvas">
        <div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
          <div class="offcanvas-header">
            <h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
            <button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
          </div>
          <div class="offcanvas-body">
            <nav class="toc" id="toc"></nav>
          </div>
        </div>
      </div>

      <div class="content">
        <div class="actionbar">
          <button class="btn btn-lg border-0 d-md-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
            <i class="bi bi-list"></i>
          </button>

          <nav id="breadcrumb"></nav>
        </div>

        <article data-uid="">
          <h1 id="geometry-objects">Geometry Objects</h1>

<p><strong><a class="xref" href="../../../../api/Hi.Geom.IGetStl.html">IGetStl</a></strong> is the base interface for all geometry objects in HiAPI, providing unified STL support.</p>
<p>Several common geometry types are available:</p>
<ul>
<li>Basic Geometrys
<ul>
<li><a class="xref" href="../../../../api/Hi.Geom.Box3d.html">Box3d</a></li>
<li><a class="xref" href="../../../../api/Hi.Geom.Cylindroid.html">Cylindroid</a></li>
<li><a class="xref" href="../../../../api/Hi.Geom.Stl.html">Stl</a></li>
<li><a class="xref" href="../../../../api/Hi.Geom.StlFile.html">StlFile</a></li>
</ul>
</li>
<li>Management Geometrys
<ul>
<li><a class="xref" href="../../../../api/Hi.Geom.TransformationGeom.html">TransformationGeom</a></li>
<li><a class="xref" href="../../../../api/Hi.Geom.GeomCombination.html">GeomCombination</a></li>
</ul>
</li>
</ul>
<p>See <a href="../mechanism/transformers/index.html">Transformations</a> for <a class="xref" href="../../../../api/Hi.Geom.TransformationGeom.html">TransformationGeom</a>.</p>
<ul>
<li><a class="xref" href="../../../../api/Hi.Mech.Topo.GeneralTransform.html">GeneralTransform</a></li>
<li><a class="xref" href="../../../../api/Hi.Mech.Topo.StaticRotation.html">StaticRotation</a></li>
<li><a class="xref" href="../../../../api/Hi.Mech.Topo.StaticTranslation.html">StaticTranslation</a></li>
</ul>
<div class="NOTE">
<h5>Note</h5>
<p>All coordinate values use standard units (millimeters, radians)</p>
</div>
<h2 id="example-usage">Example Usage</h2>
<pre><code class="lang-csharp" name="SampleCode">using System;
using System.Collections.Generic;
using Hi.Geom;
using Hi.Mech.Topo;

namespace Sample.Geom
{
    /// &lt;summary&gt;
    /// Demonstrates the creation and manipulation of geometric objects in HiAPI.
    /// Shows how to create and transform various geometry types including boxes, cylindroids, and STL files.
    /// &lt;/summary&gt;
    /// &lt;remarks&gt;
    /// ### Source Code
    /// [!code-csharp[SampleCode](~/../Hi.Sample/Geom/DemoBuildGeom.cs)]
    /// &lt;/remarks&gt;
    public static class DemoBuildGeom
    {
        /// &lt;summary&gt;
        /// Generates a collection of geometric objects for demonstration purposes.
        /// Creates various geometry types including boxes, cylindroids, STL files, and transformed geometries.
        /// &lt;/summary&gt;
        /// &lt;returns&gt;A list of geometries implementing the IGetStl interface&lt;/returns&gt;
        public static List&lt;IGetStl&gt; GenGeoms()
        {
            Box3d box = new Box3d(0, 0, -50, 70, 50, 0);
            Cylindroid cylindroid = new Cylindroid([ new PairZr(0,12),new PairZr(20,12),
                                new PairZr(20,16),new PairZr(30,16)]);
            Stl stl = new Stl(&quot;geom.stl&quot;);
            StlFile stlFile = new StlFile(&quot;geom.stl&quot;);
            TransformationGeom transformationGeom = new TransformationGeom()
            {
                Transformer = new GeneralTransform(1,
                    new StaticRotation(new Vec3d(0, 0, 1), MathUtil.ToRad(15), new Vec3d(0, 0, 0)),
                    new StaticTranslation(new Vec3d(0, 0, 0))),
                Geom = stl
            };
            GeomCombination geomCombination = new GeomCombination(stlFile, transformationGeom);
            return new List&lt;IGetStl&gt;([box, cylindroid, stl, stlFile, transformationGeom]);
        }
    }

}
</code></pre>
</article>

        <div class="contribution d-print-none">
        </div>

        <div class="next-article d-print-none border-top" id="nextArticle"></div>

      </div>

      <div class="affix">
        <nav id="affix"></nav>
      </div>
    </main>

    <div class="container-xxl search-results" id="search-results"></div>

    <footer class="border-top text-secondary">
      <div class="container-xxl">
        <div class="flex-fill">
          <span> Copyright © 2025 <a href='https://superhightech.com.tw'>Tech Coordinate</a>. All rights reserved. <a href='https://superhightech.com.tw'>超級高科技股份有限公司</a> © 2025 版權所有 </span>
        </div>
      </div>
    </footer>
  </body>
</html>
